﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BYClient
{
    public class Program
    {
        static void Main(string[] args)
        {
            YClient client = new YClient();
            Console.ReadLine();
            client.OnReceiveData += new EventHandler<EventReceiveMessareArgs>(client_OnReceiveData);
            client.Connect("localhost", 1000);
            while(true)
            {
                string a = Console.ReadLine();
                client.SendMessage(Encoding.ASCII.GetBytes(a));
            }
            
        }

        static void client_OnReceiveData(object sender, EventReceiveMessareArgs e)
        {
            Console.WriteLine(Encoding.ASCII.GetString(e.data));
        }
    }
}
